import java.util.List;
import java.util.Scanner;

// 用户界面
class UserInterface {
    private Scanner scanner;
    private List<Player> players; // 声明players变量
    public UserInterface() {
        scanner = new Scanner(System.in);
        players= PlayerImporter.importAllPlayersFromDatabase();
    }


    public int getPlayerChoice() {
        System.out.println("请输入您要选择的玩家编号:");
        return scanner.nextInt();
    }
    public void displaySelectedPlayerInfo() {
        int playerChoice = getPlayerChoice();
        if (playerChoice >= 1 && playerChoice <= players.size()) {
            Player selectedPlayer = players.get(playerChoice - 1); // 减1是因为列表索引从0开始
            System.out.println("所选取的玩家信息：");
            System.out.println("昵称：" + selectedPlayer.getName());
            System.out.println("UID：" + selectedPlayer.getUid());
            System.out.println("金钱：" + selectedPlayer.getMoney());
        } else {
            System.out.println("无效的玩家编号，请重新选择。");
        }
    }


    // 其他用户界面操作方法
}
